import os
f1 = open("D:\\text\\game scripts\\ストパニもの\\ストパニもの1.txt".encode("utf-8"),"r",encoding='Shift_JISx0213')
list = []
text_lines = f1.readlines()
for line in text_lines:
    if "voice" in line:
        str1 = line[0:len(line)-2]+".ogg\""
        list.append(str1)
        
    elif "bg" in line:
        str1 = line[0:line.rfind(".jpg")]
        list.append(str1)
        print(str1)
        continue
    
    elif line.count("\"") == 1:
        str1 = "\""+line[0:len(line)-1]
        list.append(str1)
        continue
    
f1.close()
with open("D:\\text\\game scripts\\ストパニもの\\ストパニもの01.txt".encode("utf-8"),"w") as f2:
    for ScriptText in list:
        f2.write(ScriptText+"\n")